<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-US">
<head>
<!-- GenHTML revision 25226-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Basic Requirements of a JavaServer Faces Application - The Java EE 6 Tutorial</title>
<meta name="robots" content="index,follow">
<meta name="robots" content="index,follow">
<meta name="date" content="2011-03-01">
<link rel="stylesheet" type="text/css" href="css/default.css">
<link rel="stylesheet" type="text/css" href="css/ipg.css">
<link rel="stylesheet" type="text/css" href="css/javaeetutorial.css">
</head>

<body>

<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody>
   <tr valign="top">
      <td width="400px"><p class="toc level1"><a href="docinfo.html">Document Information</a></p>
<p class="toc level1 tocsp"><a href="gexaf.html">Preface</a></p>
<p class="toc level1 tocsp"><a href="gfirp.html">Part&nbsp;I&nbsp;Introduction</a></p>
<p class="toc level2"><a href="bnaaw.html">1.&nbsp;&nbsp;Overview</a></p>
<p class="toc level2"><a href="gfiud.html">2.&nbsp;&nbsp;Using the Tutorial Examples</a></p>
<p class="toc level1 tocsp"><a href="bnadp.html">Part&nbsp;II&nbsp;The Web Tier</a></p>
<p class="toc level2"><a href="bnadr.html">3.&nbsp;&nbsp;Getting Started with Web Applications</a></p>
<p class="toc level2"><a href="bnaph.html">4.&nbsp;&nbsp;JavaServer Faces Technology</a></p>
<p class="toc level2"><a href="giepx.html">5.&nbsp;&nbsp;Introduction to Facelets</a></p>
<p class="toc level2"><a href="gjddd.html">6.&nbsp;&nbsp;Expression Language</a></p>
<p class="toc level2"><a href="bnaqz.html">7.&nbsp;&nbsp;Using JavaServer Faces Technology in Web Pages</a></p>
<p class="toc level2"><a href="gjcut.html">8.&nbsp;&nbsp;Using Converters, Listeners, and Validators</a></p>
<p class="toc level2"><a href="bnatx.html">9.&nbsp;&nbsp;Developing with JavaServer Faces Technology</a></p>
<p class="toc level2"><a href="gkmaa.html">10.&nbsp;&nbsp;JavaServer Faces Technology Advanced Concepts</a></p>
<p class="toc level2"><a href="bnawo.html">11.&nbsp;&nbsp;Configuring JavaServer Faces Applications</a></p>
<p class="toc level3"><a href="girch.html">Using Annotations to Configure Managed Beans</a></p>
<p class="toc level4"><a href="girch.html#gircr">Using Managed Bean Scopes</a></p>
<p class="toc level5"><a href="girch.html#girep">Eager Application-scoped Beans</a></p>
<p class="toc level3 tocsp"><a href="bnawp.html">Application Configuration Resource File</a></p>
<p class="toc level4"><a href="bnawp.html#giqck">Ordering of Application Configuration Resource Files</a></p>
<p class="toc level3 tocsp"><a href="bnawq.html">Configuring Beans</a></p>
<p class="toc level4"><a href="bnawq.html#bnawr">Using the <tt>managed-bean</tt> Element</a></p>
<p class="toc level4"><a href="bnawq.html#bnaws">Initializing Properties Using the <tt>managed-property</tt> Element</a></p>
<p class="toc level5"><a href="bnawq.html#bnawu">Referencing a Java <tt>Enum</tt> Type</a></p>
<p class="toc level5"><a href="bnawq.html#bnawv">Referencing an Initialization Parameter</a></p>
<p class="toc level5"><a href="bnawq.html#bnaww">Initializing Map Properties</a></p>
<p class="toc level5"><a href="bnawq.html#bnawx">Initializing Array and List Properties</a></p>
<p class="toc level5"><a href="bnawq.html#bnawy">Initializing Managed Bean Properties</a></p>
<p class="toc level4 tocsp"><a href="bnawq.html#bnaxa">Initializing Maps and Lists</a></p>
<p class="toc level3 tocsp"><a href="bnaxb.html">Registering Custom Error Messages</a></p>
<p class="toc level4"><a href="bnaxb.html#gkuhg">Using <tt>FacesMessage</tt> to Create a Message</a></p>
<p class="toc level4"><a href="bnaxb.html#bnass">Referencing Error Messages</a></p>
<p class="toc level3 tocsp"><a href="bnaxc.html">Registering Custom Localized Static Text</a></p>
<p class="toc level3"><a href="gireb.html">Using Default Validators</a></p>
<p class="toc level3"><a href="bnaxf.html">Configuring Navigation Rules</a></p>
<p class="toc level4"><a href="bnaxf.html#giqwk">Implicit Navigation Rules</a></p>
<div id="scrolltoc" class="onpage">
<p class="toc level3 tocsp"><a href="">Basic Requirements of a JavaServer Faces Application</a></p>
<p class="toc level4"><a href="#bnaxk">Configuring an Application With a Web Deployment Descriptor</a></p>
<p class="toc level5"><a href="#bnaxl">Identifying the Servlet for Lifecycle Processing</a></p>
<p class="toc level5"><a href="#bnaxm">Specifying a Path to an Application Configuration Resource File</a></p>
<p class="toc level5"><a href="#bnaxn">Specifying Where State Is Saved</a></p>
<p class="toc level4 tocsp"><a href="#giqxl">Configuring Project Stage</a></p>
<p class="toc level4"><a href="#bnaxt">Including the Classes, Pages, and Other Resources</a></p>
</div>
<p class="toc level2 tocsp"><a href="gkiow.html">12.&nbsp;&nbsp;Using Ajax with JavaServer Faces Technology</a></p>
<p class="toc level2"><a href="gkhxa.html">13.&nbsp;&nbsp;Advanced Composite Components</a></p>
<p class="toc level2"><a href="bnavg.html">14.&nbsp;&nbsp;Creating Custom UI Components</a></p>
<p class="toc level2"><a href="bnafd.html">15.&nbsp;&nbsp;Java Servlet Technology</a></p>
<p class="toc level2"><a href="bnaxu.html">16.&nbsp;&nbsp;Internationalizing and Localizing Web Applications</a></p>
<p class="toc level1 tocsp"><a href="bnayk.html">Part&nbsp;III&nbsp;Web Services</a></p>
<p class="toc level2"><a href="gijti.html">17.&nbsp;&nbsp;Introduction to Web Services</a></p>
<p class="toc level2"><a href="bnayl.html">18.&nbsp;&nbsp;Building Web Services with JAX-WS</a></p>
<p class="toc level2"><a href="giepu.html">19.&nbsp;&nbsp;Building RESTful Web Services with JAX-RS</a></p>
<p class="toc level2"><a href="gjjxe.html">20.&nbsp;&nbsp;Advanced JAX-RS Features</a></p>
<p class="toc level2"><a href="gkojl.html">21.&nbsp;&nbsp;Running the Advanced JAX-RS Example Application</a></p>
<p class="toc level1 tocsp"><a href="bnblr.html">Part&nbsp;IV&nbsp;Enterprise Beans</a></p>
<p class="toc level2"><a href="gijsz.html">22.&nbsp;&nbsp;Enterprise Beans</a></p>
<p class="toc level2"><a href="gijre.html">23.&nbsp;&nbsp;Getting Started with Enterprise Beans</a></p>
<p class="toc level2"><a href="gijrb.html">24.&nbsp;&nbsp;Running the Enterprise Bean Examples</a></p>
<p class="toc level2"><a href="bnbpk.html">25.&nbsp;&nbsp;A Message-Driven Bean Example</a></p>
<p class="toc level2"><a href="gkcqz.html">26.&nbsp;&nbsp;Using the Embedded Enterprise Bean Container</a></p>
<p class="toc level2"><a href="gkidz.html">27.&nbsp;&nbsp;Using Asynchronous Method Invocation in Session Beans</a></p>
<p class="toc level1 tocsp"><a href="gjbnr.html">Part&nbsp;V&nbsp;Contexts and Dependency Injection for the Java EE Platform</a></p>
<p class="toc level2"><a href="giwhb.html">28.&nbsp;&nbsp;Introduction to Contexts and Dependency Injection for the Java EE Platform</a></p>
<p class="toc level2"><a href="gjbls.html">29.&nbsp;&nbsp;Running the Basic Contexts and Dependency Injection Examples</a></p>
<p class="toc level2"><a href="gjehi.html">30.&nbsp;&nbsp;Contexts and Dependency Injection for the Java EE Platform: Advanced Topics</a></p>
<p class="toc level2"><a href="gkhre.html">31.&nbsp;&nbsp;Running the Advanced Contexts and Dependency Injection Examples</a></p>
<p class="toc level1 tocsp"><a href="bnbpy.html">Part&nbsp;VI&nbsp;Persistence</a></p>
<p class="toc level2"><a href="bnbpz.html">32.&nbsp;&nbsp;Introduction to the Java Persistence API</a></p>
<p class="toc level2"><a href="gijst.html">33.&nbsp;&nbsp;Running the Persistence Examples</a></p>
<p class="toc level2"><a href="bnbtg.html">34.&nbsp;&nbsp;The Java Persistence Query Language</a></p>
<p class="toc level2"><a href="gjitv.html">35.&nbsp;&nbsp;Using the Criteria API to Create Queries</a></p>
<p class="toc level2"><a href="gkjiq.html">36.&nbsp;&nbsp;Creating and Using String-Based Criteria Queries</a></p>
<p class="toc level2"><a href="gkjjf.html">37.&nbsp;&nbsp;Controlling Concurrent Access to Entity Data with Locking</a></p>
<p class="toc level2"><a href="gkjia.html">38.&nbsp;&nbsp;Improving the Performance of Java Persistence API Applications By Setting a Second-Level Cache</a></p>
<p class="toc level1 tocsp"><a href="gijrp.html">Part&nbsp;VII&nbsp;Security</a></p>
<p class="toc level2"><a href="bnbwj.html">39.&nbsp;&nbsp;Introduction to Security in the Java EE Platform</a></p>
<p class="toc level2"><a href="bncas.html">40.&nbsp;&nbsp;Getting Started Securing Web Applications</a></p>
<p class="toc level2"><a href="bnbyk.html">41.&nbsp;&nbsp;Getting Started Securing Enterprise Applications</a></p>
<p class="toc level1 tocsp"><a href="gijue.html">Part&nbsp;VIII&nbsp;Java EE Supporting Technologies</a></p>
<p class="toc level2"><a href="gijto.html">42.&nbsp;&nbsp;Introduction to Java EE Supporting Technologies</a></p>
<p class="toc level2"><a href="bncih.html">43.&nbsp;&nbsp;Transactions</a></p>
<p class="toc level2"><a href="bncjh.html">44.&nbsp;&nbsp;Resource Connections</a></p>
<p class="toc level2"><a href="bncdq.html">45.&nbsp;&nbsp;Java Message Service Concepts</a></p>
<p class="toc level2"><a href="bncgv.html">46.&nbsp;&nbsp;Java Message Service Examples</a></p>
<p class="toc level2"><a href="gkahp.html">47.&nbsp;&nbsp;Advanced Bean Validation Concepts and Examples</a></p>
<p class="toc level2"><a href="gkeed.html">48.&nbsp;&nbsp;Using Java EE Interceptors</a></p>
<p class="toc level1 tocsp"><a href="gkgjw.html">Part&nbsp;IX&nbsp;Case Studies</a></p>
<p class="toc level2"><a href="gkaee.html">49.&nbsp;&nbsp;Duke's Tutoring Case Study Example</a></p>
<p class="toc level1 tocsp"><a href="idx-1.html">Index</a></p>
</td>
      <td width="10px">&nbsp;</td>
      <td>
         <div class="header">
             <div class="banner">
                <table width="100%" border="0" cellpadding="5" cellspacing="0">
                   <tbody>
                      <tr>
                         <td valign="bottom"><p class="Banner">The Java EE 6 Tutorial
</p></td>
                         <td align="right"  valign="bottom"><img src="graphics/javalogo.png" alt="Java Coffee Cup logo"></td>
                      </tr>
                   </tbody>
                </table>
             </div>

             <div class="header-links">
	         <a href="./index.html">Home</a> | 
<a href="../information/download.html">Download</a> | 
<a href="./javaeetutorial6.pdf">PDF</a> | 
<a href="../information/faq.html">FAQ</a> | 
<a href="http://download.oracle.com/javaee/feedback.htm">Feedback</a>

             </div>
             <div class="navigation">
                 <a href="bnaxf.html"><img src="graphics/leftButton.gif" border="0" alt="Previous" title="Previous"></a>
                 <a href="p1.html"><img src="graphics/upButton.gif" border="0" alt="Contents" title="Contents"></a>
                 <a href="gkiow.html"><img src="graphics/rightButton.gif" border="0" alt="Next" title="Next"></a>
             </div>
         </div>

	 <div class="maincontent">      	 
             

<a name="bnaxj"></a><h2>Basic Requirements of a JavaServer Faces Application</h2>
<p>In addition to configuring your application, you must satisfy other requirements of JavaServer
Faces applications, including properly packaging all the necessary files and providing a deployment
descriptor. This section describes how to perform these administrative tasks.</p>

<p>JavaServer Faces 2.x applications must be compliant with at least version 2.5 of
the Servlet specification, and at least version 2.1 of the JavaServer Pages specification.
All applications compliant with these specifications can be packaged in a WAR file,
which must conform to specific requirements to execute across different containers. At a
minimum, a WAR file for a JavaServer Faces application must contain the following:</p>


<ul><li><p><a name="indexterm-814"></a><a name="indexterm-815"></a>A web application deployment descriptor, called <tt>web.xml</tt>, to configure resources required by a web application</p>

</li>
<li><p>An application configuration resource file, which configures application resources</p>

</li>
<li><p>A specific set of JAR files containing essential classes</p>

</li>
<li><p>A set of application classes, JavaServer Faces pages, and other required resources, such as image files</p>

</li></ul>
<p>For example, a Java Server Faces web application WAR file using Facelets typically
has the following directory structure: </p>

<pre>$PROJECT_DIR
[Web Pages]
+- /[xhtml documents]
+- /resources
+- /WEB-INF
   +- /classes
   +- /lib
   +- /web.xml
   +- /faces-config.xml
   +- /glassfish-web.xml </pre><p>The <tt>web.xml</tt> file (or web deployment descriptor), the set of JAR files, and
the set of application files must be contained in the <tt>WEB-INF</tt> directory of
the WAR file.</p>



<a name="bnaxk"></a><h3>Configuring an Application With a Web Deployment Descriptor</h3>
<p>Web applications are commonly configured using elements that are contained in the web
application deployment descriptor. The deployment descriptor for a JavaServer Faces application must specify
certain configurations, which include the following:</p>


<ul><li><p>The servlet used to process JavaServer Faces requests</p>

</li>
<li><p>The servlet mapping for the processing servlet</p>

</li>
<li><p>The path to the configuration resource file, if it exists and is not located in a default location</p>

</li></ul>
<p>The deployment descriptor can also specify other, optional configurations, including:</p>


<ul><li><p>Specifying where component state is saved</p>

</li>
<li><p>Encrypting state saved on the client</p>

</li>
<li><p>Compressing state saved on the client</p>

</li>
<li><p>Restricting access to pages containing JavaServer Faces tags</p>

</li>
<li><p>Turning on XML validation</p>

</li>
<li><p>Information regarding Project Stage</p>

</li>
<li><p>Verifying custom objects</p>

</li></ul>
<p>This section gives more details on these configurations. Where appropriate, it also describes
how you can make these configurations using NetBeans IDE.</p>



<a name="bnaxl"></a><h4>Identifying the Servlet for Lifecycle Processing</h4>
<p><a name="indexterm-816"></a>A requirement of a JavaServer Faces application is that all requests to the
application that reference previously saved JavaServer Faces components must go through <tt>javax.faces.webapp.FacesServlet</tt>. A
<tt>FacesServlet</tt> instance manages the request processing lifecycle for web applications and initializes the
resources required by JavaServer Faces technology.</p>

<p>Before a JavaServer Faces application can launch its first web page, the web
container must invoke the <tt>FacesServlet</tt> instance in order for the application lifecycle process
to start.</p>

<p>The following example shows the default configuration of the <tt>FacesServlet</tt>:</p>

<pre>&lt;servlet>
        &lt;servlet-name>FacesServlet&lt;/servlet-name>
        &lt;servlet-class>javax.faces.webapp.FacesServlet&lt;/servlet-class>
        &lt;/servlet></pre><p>A mapping configuration entry is provided to make sure that the <tt>FacesServlet</tt> instance is
invoked.  The mapping to <tt>FacesServlet</tt> can be a prefix mapping, such
as <tt>/faces/*</tt>, or an extension mapping, such as <tt>*.faces</tt>. The mapping is used to
identify a page as having JavaServer Faces content. Because of this, the URL
to the first page of the application must include the URL pattern mapping.</p>

<pre>&lt;servlet-mapping>
    &lt;servlet-name>FacesServlet&lt;/servlet-name>
    &lt;url-pattern>/faces/* &lt;/url-pattern>
&lt;/servlet-mapping></pre><p>In the case of prefix mapping, there are two ways to accomplish
this:</p>


<ul><li><p>The page author can include a simple HTML page, such as an <tt>index.xhtml</tt> file in the application that provides the URL to the first page. This URL must include the path to <tt>FacesServlet</tt>, as shown by this tag, which uses the mapping defined in the <tt>guessNumber</tt> application:</p>

<pre>&lt;a href="faces/greeting.xhtml"></pre></li>
<li><p>Users of the application can include the path to <tt>FacesServlet</tt> in the URL to the first page when they enter it in their browser, as shown in the example below:</p>

<pre>http://localhost:8080/guessNumber/faces/greeting.xhtml</pre></li></ul>
<p>Note that the second method allows users to start the application from the
first page of the application, rather than start it from another HTML page.
However, the second method requires users to identify the first page of the
application in the URL. When you use the first method, users need only
enter the path to the application, as shown in the following example:</p>

<pre>http://localhost:8080/guessNumber</pre><p>In the case of extension mapping, if a request comes to the
server for a page with a <tt>.faces</tt> extension, the container will send the request
to the <tt>FacesServlet</tt> instance, which will expect a corresponding page of the same
name to exist containing the content.</p>

<p>If you are using NetBeans IDE to create your application, a web deployment
descriptor is automatically created for you with default configurations. If you created your
application without an IDE, you can create a web deployment descriptor.</p>



<a name="bnaxm"></a><h4>Specifying a Path to an Application Configuration Resource File</h4>
<a name="indexterm-817"></a><p>As explained in <a href="bnawp.html">Application Configuration Resource File</a>, an application can have multiple application configuration resource files.
If these files are not located in the directories that the implementation searches
by default or the files are not named <tt>faces-config.xml</tt>, you need to specify
paths to these files.</p>

<p>To specify these paths using NetBeans IDE, do the following:</p>


<ol><li><p>Expand the node of your project in the Projects pane.</p>

</li>
<li><p>Expand the Web Pages and WEB-INF nodes that are under the project node.</p>

</li>
<li><p>Double-click <tt>web.xml</tt>.</p>

</li>
<li><p>After the <tt>web.xml</tt> file appears in the editor pane, click General at the top of the editor pane.</p>

</li>
<li><p>Expand the Context Parameters node.</p>

</li>
<li><p>Click Add.</p>

</li>
<li><p>In the Add Context Parameter dialog:</p>


<ol style="list-style-type: lower-alpha"><li><p>Enter <tt>javax.faces.CONFIG_FILES</tt> in the Param Name field.</p>

</li>
<li><p>Enter the path to your configuration file in the Param Value field.</p>

</li>
<li><p>Click OK.</p>

</li></ol>
</li>
<li><p>Repeat steps 1 through 7 for each configuration file.</p>

</li></ol>
<p>To specify paths to the files by editing the deployment descriptor directly, follow
these steps:</p>


<ol><li><p>Add a <tt>context-param</tt> element to the deployment descriptor.</p>

</li>
<li><p>Add a <tt>param-value</tt> element inside the <tt>context-param</tt> element and call it <tt>javax.faces.CONFIG_FILES</tt>.</p>

</li>
<li><p>Add a <tt>param-value</tt> element inside the <tt>context-param</tt> element and give it the path to your configuration file. For example, the path to the <tt>guessNumber</tt> application&rsquo;s application configuration resource file is <tt>/WEB-INF/faces-config.xml</tt>.</p>

</li>
<li><p>Repeat steps 2 and 3 for each application configuration resource file that your application contains.</p>

</li></ol>


<a name="bnaxn"></a><h4>Specifying Where State Is Saved</h4>
<a name="indexterm-818"></a><a name="indexterm-819"></a><p>When implementing the state-holder methods, you specify in your deployment descriptor where you
want the state to be saved, either client or server. You do this
by setting a context parameter in your deployment descriptor.</p>

<p>To specify where state is saved using NetBeans IDE, do the following:</p>


<ol><li><p>Expand the node of your project in the Projects pane.</p>

</li>
<li><p>Expand the Web Pages and WEB-INF nodes that are under the project node.</p>

</li>
<li><p>Double-click <tt>web.xml</tt>.</p>

</li>
<li><p>After the <tt>web.xml</tt> file appears in the editor pane, click General at the top of the editor pane.</p>

</li>
<li><p>Expand the Context Parameters node.</p>

</li>
<li><p>Click Add.</p>

</li>
<li><p>In the Add Context Parameter dialog:</p>


<ol style="list-style-type: lower-alpha"><li><p>Enter <tt>javax.faces.STATE_SAVING_METHOD</tt> in the Param Name field.</p>

</li>
<li><p>Enter <tt>client</tt> or <tt>server</tt> in the Param Value field.</p>

</li>
<li><p>Click OK.</p>

</li></ol>
</li></ol>
<p>To specify where state is saved by editing the deployment descriptor directly, follow
these steps:</p>


<ol><li><p>Add a <tt>context-param</tt> element to the deployment descriptor.</p>

</li>
<li><p>Add a <tt>param-name</tt> element inside the <tt>context-param</tt> element and give it the name <tt>javax.faces.STATE_SAVING_METHOD</tt>.</p>

</li>
<li><p>Add a <tt>param-value</tt> element to the <tt>context-param</tt> element and give it the value <tt>client</tt> or <tt>server</tt>, depending on whether you want state saved in the client or the server.</p>

</li></ol>
<p>If state is saved on the client, the state of the entire
view is rendered to a hidden field on the page. The JavaServer Faces
implementation saves the state on the client by default. Duke&rsquo;s Bookstore saves its
state in the client.</p>



<a name="giqxl"></a><h3>Configuring Project Stage</h3>
<p>Project Stage is a context parameter identifying the status of a JavaServer Faces
application in the software lifecycle. The stage of an application can affect the
behavior of the application. For example, error messages can be displayed during the
Development stage but suppressed during the Production stage.</p>

<p>The possible Project Stage values are as follows:</p>


<ul><li><p><tt>Production</tt></p>

</li>
<li><p><tt>Development</tt></p>

</li>
<li><p><tt>UnitTest</tt></p>

</li>
<li><p><tt>SystemTest</tt></p>

</li>
<li><p><tt>Extension</tt></p>

</li></ul>
<p>Project Stage is configured through a context parameter in the web deployment descriptor
file. Here is an example:</p>

<pre>&lt;context-param>
    &lt;param-name>javax.faces.PROJECT_STAGE &lt;/param-name>
    &lt;param-value>Development &lt;/param-value>
&lt;/context-param></pre><p>If no Project Stage is defined, the default stage is considered as
<tt>Development</tt>. You can also add custom stages according to your requirements.</p>

<p>The Project Stage value can also be configured through JNDI. When using JNDI
based Project Stage, you need to configure the JNDI resource in the
web deployment descriptor file.</p>

<pre>&lt;resource-ref>
&lt;res-ref-name>jsf/ProjectStage&lt;/res-ref-name>
&lt;res-type>java.lang.String&lt;/res-type>
&lt;/resource-ref></pre>

<a name="bnaxt"></a><h3>Including the Classes, Pages, and Other Resources</h3>
<a name="indexterm-820"></a><p>When packaging web applications using the included build scripts, you&rsquo;ll notice that the
scripts package resources in the following ways:</p>


<ul><li><p>All web pages are placed at the top level of the WAR file.</p>

</li>
<li><p>The <tt>faces-config.xml</tt> file and the <tt>web.xml</tt> file are packaged in the <tt>WEB-INF</tt> directory.</p>

</li>
<li><p>All packages are stored in the <tt>WEB-INF/classes/</tt> directory.</p>

</li>
<li><p>All application JAR files are packaged in the <tt>WEB-INF/lib/</tt> directory.</p>

</li>
<li><p>All resource files are either under the root of the web application <tt>/resources</tt> directory, or in the web application's classpath, <tt>META-INF/resources/&lt;resourceIdentifier></tt> directory. For more information on resources, see <a href="girgm.html">Resources</a>.</p>

</li></ul>
<p>When packaging your own applications, you can use NetBeans IDE or you can
use the build scripts such as those built for Ant. You can
modify the build scripts to fit your situation. However, you can continue to
package your WAR files by using the directory structure described in this section, because
this technique complies with the commonly accepted practice for packaging web applications.</p>


         </div>
         <div class="navigation">
             <a href="bnaxf.html"><img src="graphics/leftButton.gif" border="0" alt="Previous" title="Previous"></a>
             <a href="p1.html"><img src="graphics/upButton.gif" border="0" alt="Contents" title="Contents"></a>
             <a href="gkiow.html"><img src="graphics/rightButton.gif" border="0" alt="Next" title="Next"></a>
         </div>

         <div class="copyright">
      	    <p>Copyright &copy; 2011, Oracle and/or its affiliates. All rights reserved. <a href="docinfo.html">Legal Notices</a></p>
      	 </div>

      </td>
   </tr>
</tbody>
</table>
</body>
</html>

